// main
package main

import (
	"io/ioutil"
	"log"
	"os"

	//"github.com/codegangsta/cli"

	"github.com/facat/Downloader"
)

func main() {
	log.SetOutput(os.Stdout)
	log.SetOutput(ioutil.Discard)
	d := Downloader.NewDownloader()
	app := Downloader.NewCli(os.Args)
	url := app.GetUrl()
	d.Get(url)
	//d.Get("http://music.baidu.com/pc/spec/download912/BaiduMusic-12345617.exe")

	//app := cli.NewApp()
	//app.Name = "GoDownloader"
	//app.Usage = "A Downloader"
	//app.Run(os.Args)

	//d.protocolHostPort("http://music.baidu.com/pc/spec/download912/BaiduMusic-12345617.exe")

	//d.Get("http://down.360safe.com:80/setup.exe")
	//r := new(ReceiveTest)
	//r.Start()

	//ch := make(chan int)D:\MyPro\GoDownloader
	//go func(c chan int) {
	//	for i := 0; i < 5; i++ {

	//		c <- i

	//	}
	//}(ch)
	//for i := 0; i < 5; i++ {
	//	<-ch
	//	fmt.Println("ok")
	//}
	log.Println("Hello World!")
}
